export const getStorage = key => {
  const value = localStorage[key];

  if (value) {
    return JSON.parse(value);
  }
  return undefined;
};

export const setStorage = (key, value) => {
  if (typeof value === 'string') {
    localStorage[key] = value;
  } else {
    localStorage[key] = JSON.stringify(value);
  }
  return true;
};
